package com.zgjkhis.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author yzq
 * @Description 药品入库清单
 * @Date 2021/6/23 9:38
 * @Param
 * @return
 **/
@Data
@TableName("his_drug_warehousing")
public class DrugWareHousing implements Serializable {

    @TableId
    @ApiModelProperty(value = "主键id(修改时必填)")
    private Long id;
    @ApiModelProperty(value = "入库订单号(修改时必填)")
    private String wareHousingNo;
    @ApiModelProperty(value = "入库方式1：平台采购，2：退货入库，3：报溢，4：挑拨入库，5：赠品入库，6：普通入库(默认入库方式)，7：盘点入库")
    private Integer wareHousingType;
    @ApiModelProperty(value = "订单金额")
    private BigDecimal orderTotal;
    @ApiModelProperty(value = "制单人id")
    private String createUserId;
    @ApiModelProperty(value = "制单人姓名")
    private String createUserName;
    @ApiModelProperty(value = "状态1：待提交，2待审核，3：已入库，4：已驳回")
    private Integer status;
    @ApiModelProperty(value = "审核人id")
    private String checkUserId;
    @ApiModelProperty(value = "审核人姓名")
    private String checkUserName;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "药房id",required = true)
    @NotNull(message = "药房id不能为空")
    private String pharmacyId;
    @ApiModelProperty(value = "审核时间")
    private Date checkTime;
    @ApiModelProperty(value = "供应商id",required = true)
//    @NotNull(message = "供应商id不能为空")
    private Long supplierId;
    @ApiModelProperty(value = "供应商名称",required = true)
//    @NotNull(message = "供应商名称不能为空")
    private String supplierName;
    @ApiModelProperty(value = "入库人id")
    private String warehousingUserId;
    @ApiModelProperty(value = "入库人姓名")
    private String warehousingUserName;
    @ApiModelProperty(value = "入库时间")
    private Date warehousingTime;
    /** 创建时间 */
    @TableField(fill= FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;
    @ApiModelProperty(value = "药品类型")
    private Integer drugType;
    @ApiModelProperty(value = "支付状态")
    private Integer payStatus;
    @ApiModelProperty(value = "退回理由")
    private String refundContent;
    @ApiModelProperty(value = "入库药品数量")
    private Integer warehousingQuantity;

    public void copy(DrugWareHousing source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
